package com.example.workmode.Timing;


import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.os.Bundle;

public class PromptToStartBreak extends Activity {
	
	private CharSequence message = "Take a break?";
	private CharSequence yes = "Yes";
	private CharSequence no = "No";
	
	@Override
	public void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);

		final Context context = this;
		
		AlertDialog.Builder builder = new AlertDialog.Builder(context);
		builder.setCancelable(false);
		builder.setMessage(message);
		builder.setPositiveButton(yes, new OnClickListener(){

			@Override
			public void onClick(DialogInterface dialog, int which) {
				Intent timerIntent = new Intent(context, BreakTimer.class);
				context.startService(timerIntent);
			}
			
		});
		builder.setNegativeButton(no, new OnClickListener(){

			@Override
			public void onClick(DialogInterface dialog, int which) {
				Intent timerIntent = new Intent(context, WorkTimer.class);
				context.startService(timerIntent);					
			}
			
		});
		builder.show();
	}

}
